package com.guli.teacher.controller.admin;

import com.guli.teacher.entity.EduTeacher;
import com.guli.teacher.service.EduTeacherService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
@Api(description = "讲师管理")
@RestController
@RequestMapping("/teacher")
public class TeacherAdminController {
    /**
     * 获取所有讲师列表
     */
    @Autowired
    private EduTeacherService eduTeacherService;
    @ApiOperation(value = "所有讲师列表")
    @GetMapping
    public List<EduTeacher> getTeacherList() {
        List<EduTeacher> list=eduTeacherService.list(null);
        return list;
    }
    @ApiOperation(value = "根据ID删除讲师")
    @DeleteMapping("{id}")
    public boolean removeById(
            @ApiParam(value = "讲师ID",name = "id",required = true)
            @PathVariable String id
    ){
        return eduTeacherService.removeById(id);
    }
}
